package com.java.boot.boot05web01.controller;

import com.java.boot.boot05web01.bean.Person;
import org.springframework.core.io.FileSystemResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * @author jingjintao
 * @date 2021/7/25 - 22:07
 **/
@Controller
public class ResponseTestController {

    @ResponseBody //--RequestResponseBodyMethodProcessor ---> messageConverter
    @GetMapping("/he11")
    public FileSystemResource file(){

        //文件以这样的方式返回看是谁处理的（messageConverter）。
        return null;
    }

    @ResponseBody
    @GetMapping("/test/person")
    public Person getPerson(){
        Person person = new Person();
        person.setAge(20);
        person.setBirth(new Date());
        person.setUserName("zhangsan");
        return person;
    }
}
